using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Doctor_RateComplete : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        bool ok = false;

        if (Request.QueryString.Count == 1)
        {
            if (Request.QueryString["dr"] != null)
            {
                lblLine1.Text = "Thank you for rating <b>Dr. " + Request.QueryString["dr"].ToString()+"</b>";
                lblLine2.Text = "Your ratings have been saved.";
                ok = true;
            }
            else
            {
                ok = false;
            }            
        }
        else
        {
            ok = false;
        }

        if (!ok) { Response.Redirect(ConfigurationManager.AppSettings["strHttp"].ToString() + "default.aspx"); }

    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        string goToCode = "";
        //if (Request.QueryString["frompage"] != null && Request.QueryString["frompage"].ToString() == "")
        if (Session["pageFromOrAction"] != null && Session["pageFromOrAction"].ToString() != "")
        {
            //string tFrompage = Request.QueryString["frompage"].ToString().Trim();
            goToCode = Session["pageFromOrAction"].ToString();
            switch (goToCode)
            {
                case "home":
                case "simple":
                    Response.Redirect(Session["strHttps"] + "Default.aspx");
                    break;
                case "CommunityPage":
                    Response.Redirect(Session["strHttp"] + "SearchResultCom.aspx");
                    break;
                case "doctorContent":
                    Response.Redirect(Session["strHttp"] + "SearchResultsDocs.aspx");
                    break;
                case "RateDoctors":
                    Response.Redirect(Session["strHttp"] + "patient/patient_rate.aspx?fromPage=RateDoctors");
                    break;
                case "drMessage":
                    Response.Redirect(Session["strHttp"] + "boardsblogs/blogs.aspx");
                    break;
                case "advanced":
                    Response.Redirect(Session["strHttp"] + "SearchDoctors_adv.aspx");
                    break;
                default:
                    Response.Redirect(Session["strHttp"] + "SearchDoctors_adv.aspx");
                    break;
            }
        }

      
    }
}
